package com.tisson.bo;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import com.tisson.dao.AcDepartmentDAO;
import com.tisson.dao.AcDistrictDAO;
import com.tisson.pojo.AcDistrict;

public class DistrictBO {
		
	public List findAll(HttpServletRequest request){
		try{
			AcDistrictDAO dao = new AcDistrictDAO();
			return dao.findAll();
		}catch(Exception e){
			return new ArrayList();
		}
	}
	
	public void add(AcDistrict acDistrict){
		try{
			AcDistrictDAO dao = new AcDistrictDAO();
			dao.save(acDistrict);
		}catch(Exception e){
			e.printStackTrace();
		}
	}
	
	public void delete(AcDistrict acDistrict){
		try{
			AcDistrictDAO dao = new AcDistrictDAO();
			dao.delete(acDistrict);
		}catch(Exception e){
			e.printStackTrace();
		}
	}
	
	public AcDistrict findById(String id){
		try{
			AcDistrictDAO dao = new AcDistrictDAO();
			return dao.findById(id);
		}catch(Exception e){
			e.printStackTrace();
			return new AcDistrict();
		}
	}
	
	public void update(AcDistrict acDistrict){
		try{
			AcDistrictDAO dao = new AcDistrictDAO();
			dao.update(acDistrict);
		}catch(Exception e){
			e.printStackTrace();
		}
	}

}
